/**
 * 跳转到抽奖界面
 */
var goLotto1 = document.getElementsByClassName('index-arrows')[0];
var goLotto2 = document.getElementsByClassName('go-lotto')[0]; 
var music = document.getElementsByClassName('music')[0];

goLotto1.onclick = function() {
	//获取当前音乐的播放进度
	var tempo = music.currentTime;
	window.location.href = 'lotto.html?tempo=' + tempo;
}
goLotto2.onclick = function() {
	//获取当前音乐的播放进度
	var tempo = music.currentTime;
	window.location.href = 'lotto.html?tempo=' + tempo;
}


/**
 * 解决移动端音频不能自动播放的问题
 */


var audio = document.getElementsByClassName('music')[0];
if( audio != '' ) {
	console.log(audio.id);
	document.body.addEventListener('touchstart',function(){
		audio.play();
		audio.id = '';
	});
}

